forum

home / developersection / forums / having trouble showing gridview

Having trouble showing GridView

Anonymous User 1924 04-Feb-2014

Here is my code

public void gridshow() {
        sc.Open();
        //int custtid ;
        //custtid = (int)cidshow.SelectedItem;
        SqlDataAdapter da = new SqlDataAdapter("select Cust_id , Cust_name from Cust_master where Cust_id = '" + cidshow.SelectedItem + "'", sc);
        DataSet ds = new DataSet();
        da.Fill(ds,"Cust_master");
        custshow.DataSource = ds.Tables[0];
        sc.Close();
    }

Error raised is

(Conversion failed when converting the varchar value 'System.Data.DataRowView' to data type int.)


c# c# 
Updated on 04-Feb-2014

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By